package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpToolsUDFDefaultPageUtil extends SeleniumPageUtil {
	public final static By TUDF_SPAN_HEADER = By.id("lblHeader");
	public final static By TUDF_LINK_TEMPLATES = By.id("FormsList1_btnTemplates");
	public final static By TUDF_LINK_NEW_FORM = By.id("FormsList1_btnNewForm");
	public final static By TUDF_LINK_RESTRICTION_LISTS = By.id("FormsList1_btnRestrictLists");
	public final static By TUDF_SPAN_UDR_HEADER = By.id("FormsList1_lblHdr");
	public final static By TUDF_TD_UDFNAME = By.xpath("//*[@id='tblResults']/tbody/tr[2]/td[2]");
	public final static By TUDF_TD_NUMFIELDS = By.xpath("//*[@id='tblResults']/tbody/tr[2]/td[3]");
	public final static By TUDF_TD_COMMENT = By.xpath("//*[@id='tblResults']/tbody/tr[2]/td[4]");
	
	
	public static void enterToolsUserDefinedFormsPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.enterToolsUserDefinedFormsPage();
	}
	
	public static void waitForPageToLoad(){
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				TUDF_LINK_TEMPLATES, TUDF_LINK_NEW_FORM, TUDF_LINK_RESTRICTION_LISTS
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(TUDF_LINK_TEMPLATES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(TUDF_LINK_NEW_FORM));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(TUDF_LINK_RESTRICTION_LISTS));
	}
}
